package com.wowoai.wallpaper.entity;

import com.wowoai.common.basemodule.BaseEntity;
import com.wowoai.utils.IdGeneratorUtil;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Getter
@Setter
@Table(name = "wallpaper")
@Entity
public class WallpaperEntity extends BaseEntity {

    @Column(name = "name")
    private String name;

    @Column(name = "url")
    private String url;

    public static WallpaperEntity create(Long id, Long userId,String creatorName){
        WallpaperEntity wallpaperEntity = new WallpaperEntity();
        wallpaperEntity.setId(id);
        wallpaperEntity.setDeleted(Boolean.FALSE);
        wallpaperEntity.setCreateTime(System.currentTimeMillis());
        wallpaperEntity.setCreatorId(userId);
        wallpaperEntity.setCreatorName(creatorName);

        return wallpaperEntity;
    }
}
